package com.taxi.apiDriver.service;

import com.taxi.apiDriver.remote.ServiceDriverUserClient;
import com.taxi.common.dto.DriverCarBindingRelationship;
import com.taxi.common.dto.DriverUser;
import com.taxi.common.dto.DriverUserWorkStatus;
import com.taxi.common.dto.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author ruomengjiang
 * @Date 2022/7/31
 * @Description : online-taxi
 * @Version: 1.0
 */
@Service
public class UserService {

    @Autowired
    private ServiceDriverUserClient serviceDriverUserClient;

    public ResponseResult updateUser(DriverUser driverUser){
        return serviceDriverUserClient.updateUser(driverUser);
    }

    /**
     * 修改司机工作状态
     * @param driverUserWorkStatus
     * @return
     */
    public ResponseResult changeWorkStatus(DriverUserWorkStatus driverUserWorkStatus){
        return serviceDriverUserClient.changeWorkStatus(driverUserWorkStatus);
    }

    /**
     * 根据driverPhone查询司机信息
     * @param driverPhone
     * @return
     */
    public ResponseResult<DriverCarBindingRelationship> getDriverCarBindingRelationship(String driverPhone){
        return serviceDriverUserClient.getDriverCarRelationShip(driverPhone);
    }

    /**
     * 司机工作状态查询
     * @param driverId
     * @return
     */
    public ResponseResult<DriverUserWorkStatus> getWorkStatus(Long driverId){
        return serviceDriverUserClient.getWorkStatus(driverId);
    }
}
